package com.dmall.manager.controller;

import com.dmall.manager.service.ItemCatService;
import com.dmall.utils.EasyUITreeNodeInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 商品分类管理Controller
 * @author Chen 2017/10/12
 */
@Controller
@RequestMapping(value = "/item/cat")
public class ItemCatController {
    @Autowired
    private ItemCatService itemCatService;

    @RequestMapping("list")
    @ResponseBody
    public List<EasyUITreeNodeInfo> getItemCatList(@RequestParam(name = "id",defaultValue = "0") Long parentId){
        List<EasyUITreeNodeInfo> list = itemCatService.getItemCatList(parentId);
        return list;
    }
}
